import { CHANGE_IS_LOGIN, CHANGE_USERINFO } from './userActiveTypes';

let defaultState = {
    isLogin: true,
    userInfo: {
        phone: 'admin',
        code: 123456
    }
}
export default (state = defaultState, action) => {
    if (action.type === CHANGE_IS_LOGIN) {
        let initState = JSON.parse(JSON.stringify(state));
        initState.isLogin = action.value;
        return initState;
    }
    if (action.type === CHANGE_USERINFO) {
        let initState = JSON.parse(JSON.stringify(state));
        initState.userInfo = action.value;
        return initState;
    }
    return state;
}